package mines;

import gui.Window;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;

public abstract class MineType extends JButton {

	protected final int MINESIZE = 25;
	protected boolean active = true;
	
	protected Window window;

	public MineType(Window window) {
		this.window = window;
		
		setup();
		addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent arg0) {
					pressed();
					action();
			}
		});
	}

	private void setup() {
		this.setPreferredSize(new Dimension(MINESIZE, MINESIZE));
	}

	public void pressed() {
		this.setBorder(null);
		this.setBackground(Color.white);
		this.setEnabled(false);
		this.setForeground(Color.cyan);
	}

	public abstract void action();
	public abstract void reveal();
}
